package com.autologistics.model;

/**
 * GoodsorderId entity. @author MyEclipse Persistence Tools
 */

public class GoodsorderId implements java.io.Serializable {

	// Fields

	private Goods goods;
	private Ordertable ordertable;
	private Integer goodsNum;

	// Constructors

	/** default constructor */
	public GoodsorderId() {
	}

	/** full constructor */
	public GoodsorderId(Goods goods, Ordertable ordertable, Integer goodsNum) {
		this.goods = goods;
		this.ordertable = ordertable;
		this.goodsNum = goodsNum;
	}

	// Property accessors

	public Goods getGoods() {
		return this.goods;
	}

	public void setGoods(Goods goods) {
		this.goods = goods;
	}

	public Ordertable getOrdertable() {
		return this.ordertable;
	}

	public void setOrdertable(Ordertable ordertable) {
		this.ordertable = ordertable;
	}

	public Integer getGoodsNum() {
		return this.goodsNum;
	}

	public void setGoodsNum(Integer goodsNum) {
		this.goodsNum = goodsNum;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof GoodsorderId))
			return false;
		GoodsorderId castOther = (GoodsorderId) other;

		return ((this.getGoods() == castOther.getGoods()) || (this.getGoods() != null
				&& castOther.getGoods() != null && this.getGoods().equals(
				castOther.getGoods())))
				&& ((this.getOrdertable() == castOther.getOrdertable()) || (this
						.getOrdertable() != null
						&& castOther.getOrdertable() != null && this
						.getOrdertable().equals(castOther.getOrdertable())))
				&& ((this.getGoodsNum() == castOther.getGoodsNum()) || (this
						.getGoodsNum() != null
						&& castOther.getGoodsNum() != null && this
						.getGoodsNum().equals(castOther.getGoodsNum())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getGoods() == null ? 0 : this.getGoods().hashCode());
		result = 37
				* result
				+ (getOrdertable() == null ? 0 : this.getOrdertable()
						.hashCode());
		result = 37 * result
				+ (getGoodsNum() == null ? 0 : this.getGoodsNum().hashCode());
		return result;
	}

}